#include <assert.h>
#include <stdio.h>

#define MAXN 1000

typedef int DataType;
int n;//num in the array
DataType v[MAXN];

int sorted()
{
  int i;
  for(i=0;i<n-1;++i)
    if(v[i]>v[i+1])
      return 0;//unsorted
  return 1;//sorted
}

int binarysearch(DataType key)
/*precondition: v is sorted in nondecreasing order v[i]<=v[i+1]
  postcondition:
  result = -1    =>   t is not in v
  0<=result<n    =>   v[result] == t
*/
{
  int low,mid,high;
  int size,oldsize;
  assert(sorted());
  low = 0;
  high = n-1;
  size = n+1;
  //loop invariant: if t is in v, then t is in v[low] to v[high]
  while(low<=high){
    oldsize = size;
    size = high-low+1;
    assert(size<oldsize);

    mid = (low+high)/2;
    if(key<v[mid])
      high = mid-1;
    else if(key>v[mid])
      low = mid+1;
    else {
      assert(0<=mid && mid<n && v[mid]==key);
      return mid;
    }
  }
  assert( (high<0||v[high]<key) && (high+1>=n||key<v[high+1]) );
  return -1;
}

int main()
{
  int i;
  DataType key;
  while(scanf("%d %d",&n,&key) !=EOF) {
    for(i = 0; i<n; ++i)
      v[i] = i*10;
    printf(" %d\n",binarysearch(key) );
  }
  return 0;
}
